/*
 * iso15693.h
 *
 *  Created on: Aug 22, 2024
 *      Author: 31652
 */

#ifndef INC_ISO15693_H_
#define INC_ISO15693_H_

///////private CMD define///////////
#define _Cmd_Inv          0x00

#define _Cmd_Read_Block   0x91
#define _Cmd_Read_Blocks  0x95

#define _Cmd_Write_Block  0x92
#define _Cmd_Write_Blocks 0x94

#define _Cmd_Lock         0x93
////////////////////////////////////

#include <stdio.h>
#include <stdint.h>

typedef void(*ReadBlockCallback)(uint8_t blockNum, uint8_t* data, uint8_t errCode);
typedef void(*ReadBlocksCallback)(uint8_t beginBlock, uint8_t blocks, uint8_t* data, uint8_t errCode);
typedef void(*WriteBlockCallback)(uint8_t blockNum, uint8_t errCode);
typedef void(*WriteBlocksCallback)(uint8_t blockNum, uint8_t blocks, uint8_t errCode);

typedef void(*LockBlockCallback)(uint8_t blockNum, uint8_t errCode);

void _15693_set_read_block_listener(ReadBlockCallback listener);
void _15693_set_read_blocks_listener(ReadBlocksCallback listener);
void _15693_set_write_block_listener(WriteBlockCallback listener);
void _15693_set_write_blocks_listener(WriteBlocksCallback listener);
void _15693_set_lock_block_listener(LockBlockCallback listener);

void _15693_on_read_block_resp(uint8_t blockNum, uint8_t* data, uint8_t errCode);
void _15693_on_read_blocks_resp(uint8_t beginBlock, uint8_t blocks, uint8_t* data, uint8_t errCode);

void _15693_on_write_block_resp(uint8_t blockNum, uint8_t errCode);
void _15693_on_write_blocks_resp(uint8_t blockNum, uint8_t blocks, uint8_t errCode);
void _15693_on_lock_block_resp(uint8_t blockNum, uint8_t errCode);

#endif /* INC_ISO15693_H_ */
